package com.ant.cn.mylibrary.activities;

import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.ant.cn.mylibrary.R;
import com.ant.cn.mylibrary.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by baichuan on 2016/11/10.
 */
public class LaunchListActivity extends BaseActivity implements View.OnClickListener {

    protected List<String> slt;
    protected List<Class> clt;
    protected ListView lv;


    @Override
    public int getLaout() {
        slt = new ArrayList<String>();
        clt = new ArrayList<Class>();
        return R.layout.ac_libary_layout;
    }

    @Override
    public void initView() {
        lv = (ListView) findViewById(R.id.ac_libary_test01);
    }

    @Override
    public void initData() {
        getListData();

        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, slt);
        lv.setAdapter(adapter);
    }

    @Override
    public void initListener() {
        lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
                LaunchListActivity.this.startActivity(new Intent(LaunchListActivity.this, clt.get(position)));
            }
        });
    }


    public void getListData() {

    }

    @Override
    public void onClick(View view) {

    }
}
